

package Test;


public class Shell_Sort {


   static void sort(int[] array){
   int i, j, k, p=0, m=1, b=array.length;
   int[] d = {1};
   while (--m >= 0){
      k = d[m];
      for (i=k; i<b; i++){
         j=i;
         p=array[i];
         while ((j >= k) && (array[j-k] > p)){
              array[j]=array[j-k];
              j =  j-k;
         }
         array[j] = p;
      }
   }
}

}
